{extend name="index/index" /}

{block name="navigation"}
<nav class="main-nav">
    <div class="menu-top-menu-container">
        <ul id="menu-top-menu" class="clearfix">
            <li><a href="{:url('index/index/index')}">首页</a></li>
            <li><a href="{:url('index/Recall/index')}">韶华追忆</a></li>
            <li class="current-menu-item"><a href="{:url('index/Mood/index')}">心情随笔</a></li>
            <li><a href="{:url('index/Share/index')}">技术分享</a></li>
            <li><a href="{:url('index/Post/index')}">技术讨论</a></li>
            <!--<li><a href="{:url('index/Archive/index')}">个人归档</a></li>-->
            <li><a href="{:url('/index/Me/index')}">关于我</a></li>
        </ul>
    </div>
</nav>
{/block}

{block name="indexmain"}
<!-- 引用动态框和jquery -->
{css href="/static/index/css/toastr.min.css" }
{js href="/static/index/js/jquery.min.js"}
{js href="/static/index/js/toastr.min.js"}
{css href="/static/index/assets/libs/bootstrap/css/bootstrap.min.css"}
{js href="/static/index/assets/libs/bootstrap/js/bootstrap.min.js"}
<div class="page-container">
    <div class="container">
        <div class="row">

            <!-- start of page content -->
            <div class="span8 main-listing">
                <article class="format-standard type-post hentry clearfix">
                    <h2><a href="{:url('index/index/index')}">>>返回主页</a></h2>
                    {volist name="lists" id="v"}
                    <header class="clearfix" style="padding:20px 21px 27px 27px;border:1px solid #e0e0e0;line-height:22px;margin-bottom: 10px;">

                        <div class="post-meta clearfix">
                            <span class="date">{$v.arttime}</span>
                        </div><!-- end of post meta -->
                        <p>{$v.artcontent}</p>
                    </header>
                    {/volist}
                </article>
            </div>
            <aside class="span4 page-sidebar">

                <section class="widget" style="margin-top: 30px;">
                    <div class="support-widget">
                        <h3 class="title">我是博主啦</h3>
                        <p class="intro">关于我的一些心情和分享的一些小的知识呢，大家也可以积极的讨论...</p>
                    </div>
                </section>


                <section class="widget">
                    <h3 class="title">热门文章</h3>
                    <ul class="articles">
                        {volist name="love" id="v"}
                        <li class="article-entry standard">
                            <h4><a href="{:url('index/article/index',['id'=>$v['art_id']])}">{$v.artname}</a></h4>
                            <span class="article-meta">{$v.arttime}</span>
                            <span class="like-count"  datalove = '{$v.art_id}'>{$v.artlove}</span>
                        </li>
                        {/volist}
                    </ul>
                </section>

                <section class="widget"><h3 class="title">友情链接</h3>
                    <ul>
                        {volist name="links" id="v"}
                        <li><a href="{$v.linksurl}" title="Lorem ipsum dolor sit amet,">{$v.linksname}</a> </li>
                        {/volist}
                    </ul>
                </section>

            </aside>
            <!-- end of page content -->
        </div>
    </div>
</div>

<!-- 点赞的ajax -->

<script type="text/javascript">

    $('.like-count').click(function (){
        var info = 'artid' + '=' + $(this).attr('datalove');
        var thisbtn = $(this);
        // alert(info);
        $.ajax({
            type: 'post',
            url: '/index/article/artlove',
            data: info,
            dataType : 'json',
            success : function (data){
                if(data.status){
                    // toastr.success('点赞成功');
                    thisbtn.html(data.love);
                    thisbtn.attr('style','color:blue;');

                    // window.location.reload();

                }else{
                    toastr.error('点赞失败');
                }
            },
            error : function () {
                alert('执行失败');

            }
        });

    });

</script>


<!-- 点赞的ajax -->

{/block}